Domain settings: networking layer changes for 2 endpoints #8600
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #8558
Description
Why
After the user creates a store, they might want to choose a proper domain for their new store. The domain settings screen shows the domains of a WPCOM site, and allows the merchant to add a domain either using their domain credit or the checkout flow similar to the Jetpack app.
Networking layer changes
More technical details at the spike: pe5sF9-Ug-p2
This PR just contains the networking layer changes, since the JSON response files were pretty large. There are two endpoints required to show the domain settings UI:
DomainRemoteProtocol.loadDomains: this loads the site's domains, including the free staging domainPaymentRemoteProtocol.loadSiteCurrentPlan: this loads the site's WPCOM plans, and returns the current plan to determine if the site has domain credit so that the user can pick a domain for free (available from certain WPCOM plans)WPCOMPlanfield ofWPComSitePlanwas removed since it requires extra manual parsing due to the API response, and we're not using this field for the foreseeable futureSome manual decoding was required for both endpoints since the API response isn't straightforward, I added comments in the code.
Testing instructions
The changes aren't used in the Yosemite layer yet, they will be in the next PR. Just CI is sufficient.
RELEASE-NOTES.txtif necessary.